from pydantic import BaseModel, Field
from typing import Optional
from datetime import datetime


class StaffResponse(BaseModel):
    id: Optional[int] = Field(None, description="业务员ID")
    name: str = Field(..., description="业务员姓名")
    department: str = Field(..., description="所属事业部")
    type: str = Field(..., description="类型")
    pm: str = Field(..., description="PM")
    status: Optional[str] = Field(None, description="状态")
    supervisor: str = Field(..., description="主管")
    is_supervisor: str = Field(..., description="是否主管(Y/N)")
    third_department: str = Field(..., description="三级部门")
    industry: Optional[str] = Field(None, description="行业")
    # 若模型存在时间戳字段，可展示；否则为 None
    create_time: Optional[datetime] = Field(None, description="创建时间")
    update_time: Optional[datetime] = Field(None, description="更新时间")

    class Config:
        from_attributes = True